{% extends "base.html" %}

{% block titulo %}Página del curso - {{course.name}}{% endblock %}

{%block style%}<link rel="stylesheet" type="text/css" href="/stylesheets/courseHomeStyle.css" />{%endblock%}

{% block breadcrumbs %}<div id="middleBreadcrumb">
                            <a href="/home/">home</a> >
                       </div>
                       <div id="lastBreadcrumb">
                            {{course.name}}
                       </div>{% endblock %}
{% block cuerpo %}


<br />
<div id="course_name">{{course.name}}</div>


<div id="course_teacher_block">
    <div id="course_teacher_info">

    Curso impartido por <a href="/teacher/{{group.id}}/">{{group.teacher.get_full_name}}</a>
    <br />
    </div>
</div>

<div>
    {% if day %}
        <br />
        Hoy es: {{day}} {{intDay}} de {{month}}
        <br />
    {% endif %}
</div>
<div id="activityLeftDiv">
    <div id="activity_module">
        <table id="rounded-corner">
            <thead>
                <tr>
                    <th scope="col" class="rounded-left"></th>
                    <th scope="col" class="rounded-right"><a class="table_title" href="/news/{{course.code}}/{{group.code}}/">Noticias</a></th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                    <td class="rounded-foot-left"></td>
                    <td class="rounded-foot-right"></td>
                </tr>
            </tfoot>
            <tbody>
                {%if newsList%}
                    {%for news in newsList%}
                    
                    <tr>
                        <td><center><img src="/resources/webImages/news.png" width="25" height="25" /></center></td>
                        <td onclick="getLink('{{news.get_absolute_url}}')">
                            <small>{{news.date|date:"M d [P]"}}</small><br />
                            Se ha agregado una noticia: <a href="{{news.get_absolute_url}}">{{news.title}}</a>
                        </td>
                    </tr>
                    {%endfor%}
                {%else%}
                    <tr>
                        <td><center><img src="/resources/webImages/none.png" width="20" height="20" /></center></td>
                        <td>No hay noticias por el momento</td>
                    </tr>
                {%endif%}
            </tbody>
        </table>
    </div>

    <div id="activity_module">
        <table id="rounded-corner">
            <thead>
                <tr>
                    <th scope="col" class="rounded-left"></th>
                    <th scope="col" class="rounded-right"><a class="table_title"  href="/forum/{{course.code}}/{{group.code}}/">Foro</a></th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                <td class="rounded-foot-left"></td>
                <td class="rounded-foot-right"></td>
                </tr>
            </tfoot>
            <tbody>
                {%if forumActivity%}
                    {%for element in forumActivity%}
                        {%ifequal element.0 "Thread"%}
                            <tr>
                                <td><center><img src="/resources/webImages/add.png" width="18" height="18" /></center></td>
                                <td onclick="getLink('{{element.1.get_absolute_url}}')">
                                    <small>{{element.1.date|date:"M d [P]"}}</small><br />
                                    {{element.1.group.teacher.get_full_name}} ha creado un nuevo tema: <a href="{{element.1.get_absolute_url}}">{{element.1.title}}</a>
                                </td>
                            </tr>
                        {%endifequal%}
                        {%ifequal element.0 "Post"%}
                            <tr>
                                <td><center><img src="/resources/webImages/post.png" width="25" height="25" /></center></td>
                                <td onclick="getLink('{{element.1.thread.get_absolute_url}}')">
                                    <small>{{element.1.date|date:"M d [P]"}}</small><br />
                                    {{element.1.creator.get_full_name}} ha posteado <strong>"{{element.1.title}}"</strong> en <a href="{{element.1.thread.get_absolute_url}}">{{element.1.thread.title}}</a>
                                </td>
                            </tr>
                        {%endifequal%}
                    {%endfor%}
                {%else%}
                    <tr>
                        <td><center><img src="/resources/webImages/none.png" width="20" height="20" /></center></td>
                        <td>No hay nuevos temas en el foro</td>
                    </tr>
                {%endif%}
            </tbody>
        </table>
    </div>

</div>
<!--Starts Right Activities Div-->


<div id="activityRightDiv">
    <div id="activity_module">
       <table id="rounded-corner">
            <thead>
                <tr>
                    <th scope="col" class="rounded-left"></th>
                    <th scope="col" class="rounded-right"><a  class="table_title" href="/fileMenu/{{course.code}}/{{group.code}}/">Archivos</a> y <a  class="table_title" href="/viewVideoMenu/{{course.code}}/{{group.code}}/">Multimedia</a></th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                <td class="rounded-foot-left"></td>
                <td class="rounded-foot-right"></td>
                </tr>
            </tfoot>
            <tbody>
                {%if fileVideoActivity%}
                    {%for element in fileVideoActivity%}
                        {%ifequal element.0 "Video"%}
                            <tr>
                                <td><center><img src="/resources/webImages/video.png" width="24" height="27" /></center></td>
                                <td onclick="getLink('/viewVideo/{{course.code}}/{{group.code}}/{{element.1.filename}}/')">
                                    <small>{{element.1.date|date:"M d [P]"}}</small><br />
                                    Se ha agregado un nuevo video: <a href="/viewVideo/{{course.code}}/{{group.code}}/{{element.1.filename}}/">{{element.1.title}}</a>
                                </td>
                            </tr>
                        {%endifequal%}
                        {%ifequal element.0 "File"%}
                            <tr>
                                <td><center><img src="/resources/webImages/file.png" width="25" height="25" /></center></td>
                                <td onclick="getLink('{{element.1.get_absolute_url}}')">
                                    <small>{{element.1.date|date:"M d [P]"}}</small><br />
                                    Se ha agregado un nuevo archivo: <a href="{{element.1.get_absolute_url}}">{{element.1.title}}</a>
                                </td>
                            </tr>
                        {%endifequal%}
                    {%endfor%}
                {%else%}
                    <tr>
                        <td><center><img src="/resources/webImages/none.png" width="20" height="20" /></center></td>
                        <td>No se han subido archivos o videos </td>
                    </tr>
                {%endif%}
            </tbody>
        </table>
    </div>

    <div id="activity_module">

        <table id="rounded-corner">
            <thead>
                <tr>
                    <th scope="col" class="rounded-left"></th>
                    <th scope="col" class="rounded-right"><a  class="table_title" href="/calificaciones/{{course.code}}/{{group.code}}/">Calificaciones</a></th>
                </tr>
            </thead>
            <tfoot>
                <tr>
                <td class="rounded-foot-left"></td>
                <td class="rounded-foot-right"></td>
                </tr>
            </tfoot>
            <tbody>
                  
                    <tr>
                        <td><center><img src="/resources/webImages/grades.gif" width="25" height="27" /></center></td>
                        <td onclick="getLink('/calificaciones/{{course.code}}/{{group.code}}/')">
                        {%ifequal lastDate "0" %}
                            {{group.teacher.get_full_name}} no ha subido calificaciones.
                        {%else%}
                            Las calificaciones se actualizaron el:<br />
                            {{ lastDate }}
                        {%endifequal%}
                        </td>
                    </tr>
                
            </tbody>
            <thead>
                <tr>
                    <th scope="col" class="middle-left"></th>
                    <th scope="col" class="middle-right">Retroalimentaci&oacute;n</th>
                </tr>
            </thead>
            <tbody>

                    <tr>
                        <td><center><img src="/resources/webImages/calendar.png" width="24" height="24" /></center></td>
                        <td>
                            {% if weekDayEnd %}
                                La siguiente retroalimentaci&oacute;n se dar&aacute; el:<br />
                                {{weekDayEnd.2}} {{weekDayEnd.1}}, de {{weekDayEnd.3}}
                            {%else%}
                                {{group.teacher.name}} no ha establecido el sistema de retroalimentaci&oacute;n.
                            {% endif %}
                        </td>
                    </tr>

            </tbody>
        </table>

    </div>
</div>


<div id="course_home_content">

</div>
{% endblock %}
